package com.mall4j.cloud.user.application.service.impl;

import com.mall4j.cloud.user.application.model.cmd.RegisterCmd;
import com.mall4j.cloud.user.application.service.UserAppService;
import com.mall4j.cloud.user.domain.entity.User;
import com.mall4j.cloud.user.domain.repository.UserRepository;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class UserAppServiceImpl implements UserAppService {

    @Resource
    UserRepository userRepository;

    @Override
    public void register(RegisterCmd registerCmd) {
        User user = User.builder().build();
        user.register(registerCmd.getNickName());
        userRepository.save(user);
    }
}
